<template>
	<view>
		<view class="notice-item" v-for="s,i in notice" :key='i' @click="go(i)">
			<text class="time">{{s.time}}</text>
			<view class="content">
				<text class="title">{{s.title}}</text>
				<text class="introduce">
					{{s.context}}
				</text>
				<view class="bot b-t">
					<text>查看详情</text>
					<text class="more-icon yticon icon-you"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				notice:[{
					id:1,
					title:'好友接受了你的邀请',
					time:'2021-4-24 20:56',
					context:'你邀请他一起玩，他现在同意了，赶紧一起去玩吧~',
					type:'order',
					tagId:1,
				},{
					id:12,
					title:'有人邀请你约她玩',
					time:'2021-4-24 20:54',
					context:'有个可爱的小姐姐想跟你一起玩，快去约她一起玩吧~',
					type:'okami',
					tagId:2,
				},{
					id:13,
					title:'收到评论',
					time:'2021-4-24 20:50',
					context:'手心的蔷薇：不是这样的',
					type:'comment',
					tagId:3,
				}]
			}
		},
		methods: {
			go(i){
				console.debug('跳转', this.notice[i].type);
				if(this.notice[i].type == 'order'){
					uni.navigateTo({
						url:'../order_details/order_details?id='+this.notice[i].tagId
					});
				}else if(this.notice[i].type == 'okami'){
					uni.navigateTo({
						url:'../okami_details/okami_details?id='+this.notice[i].tagId
					});
				}else if(this.notice[i].type == 'comment'){
					uni.navigateTo({
						url:'../moment_details/moment_details?id='+this.notice[i].tagId
					});
				}
			}
		}
	}
</script>

<style lang='scss'>
	page {
		background-color: #f7f7f7;
		padding-bottom: 30upx;
	}

	.notice-item {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.time {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 80upx;
		padding-top: 10upx;
		font-size: 26upx;
		color: #7d7d7d;
	}

	.content {
		width: 710upx;
		padding: 0 24upx;
		background-color: #fff;
		border-radius: 4upx;
	}

	.title {
		display: flex;
		align-items: center;
		height: 90upx;
		font-size: 32upx;
		color: #303133;
	}

	.img-wrapper {
		position: relative;
	}

	.pic {
		display: block;
		width: 100%;
		height: 100%;
		border-radius: 6upx;
	}

	.cover {
		display: flex;
		justify-content: center;
		align-items: center;
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .5);
		font-size: 36upx;
		color: #fff;
	}

	.introduce {
		display: inline-block;
		padding: 16upx 0;
		font-size: 28upx;
		color: #606266;
		line-height: 38upx;
	}

	.bot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 80upx;
		font-size: 24upx;
		color: #707070;
		position: relative;
	}

	.more-icon {
		font-size: 32upx;
	}
</style>
